home *** CD-ROM | disk | FTP | other *** search
/ 3D Game Programming All in One / 3D Game Programming All in One Disc.iso / 3D2E / demo / server / scripts / markers.cs < prev    next >
Text File  |  2005-11-23  |  1KB  |  38 lines

  1. //-----------------------------------------------------------------------------
  2. // Torque Game Engine 
  3. // Copyright (C) GarageGames.com, Inc.
  4. //-----------------------------------------------------------------------------
  5.  
  6. datablock MissionMarkerData(WayPointMarker)
  7. {
  8.    category = "Misc";
  9.    shapeFile = "~/data/shapes/markers/octahedron.dts";
  10. };
  11.  
  12. datablock MissionMarkerData(SpawnSphereMarker)
  13. {
  14.    category = "Misc";
  15.    shapeFile = "~/data/shapes/markers/octahedron.dts";
  16. };
  17.  
  18.  
  19. //------------------------------------------------------------------------------
  20. // - serveral marker types may share MissionMarker datablock type
  21. function MissionMarkerData::create(%block)
  22. {
  23.    switch$(%block)
  24.    {
  25.       case "WayPointMarker":
  26.          %obj = new WayPoint() {
  27.             dataBlock = %block;
  28.          };
  29.          return(%obj);
  30.       case "SpawnSphereMarker":
  31.          %obj = new SpawnSphere() {
  32.             datablock = %block;
  33.          };
  34.          return(%obj);
  35.    }
  36.    return(-1);
  37. }
  38.